<template>
    <div id="background">
        <el-container >
            <el-header id="fwxyHead">
                <el-row type="flex" style="height:80%;display:flex;align-items: flex-end">
                    <el-col :xs="2" :sm="2" :md="2" :offset="1" class="imgCol">
                        <img v-bind:src="backIcon" class="backSize" @click="back" />
                    </el-col>
                    <el-col :xs="6" :sm="6" :md="6" :offset="6" class="imgCol">
                        <span class="titleSize">服务协议</span>
                    </el-col>
                </el-row>
            </el-header>
            <el-main id="fwxyMain">
                <div v-for="(xieYi,key) in fuWuXieYi" :key="key" class="fuWuXieYi">
                    {{xieYi}}
                </div>
            </el-main>
        </el-container>
    </div>    
</template>

<script>
import backIcon from '../../assets/img/mine/back.png'
export default {
    data(){
        return{
            fuWuXieYi:[],
            backIcon:backIcon,
            normalHeight:document.documentElement.clientHeight,
        }
    },
    mounted(){
        var bg = document.getElementById("background");
       // this.normalHeight=document.documentElement.clientHeight;
        console.log("height:"+this.normalHeight);
        bg.style.height = this.normalHeight+"px";
        bg.style.backgroundColor = "#FFFFFF"
        bg.style.margin = "0px";

        var head=document.getElementById("fwxyHead");
        var headHeight=this.normalHeight/30 *4 ;
        console.log("headHeight:"+headHeight);
        head.style.height=headHeight+"px";

        var main=document.getElementById("fwxyMain");
        var mainHeight=this.normalHeight/30 *26 ;
        main.style.height=mainHeight+"px";

        this.getfwxy();
    },
    methods:{
        getfwxy(){
            var URL=this.IP.IP+'/system/getServiceAgreement';
            this.$ajax({
                    method:'get',
                    url:URL,
                }).then(response =>{
                this.fuWuXieYi=response.data.data.serviceAgreement;
                console.log(fuWuXieYi);
                }).catch(error => {
                console.log('sad');
                });
        },
        back(){
            console.log("back:");
            this.$router.go(-1);
        },
    }
}
</script>

<style>
.fuWuXieYi{
    color: #707070;
    font-size: 15px;
    margin: 5px;
}
#fwxyMain{
    padding: 15px;
    background: #FFFFFF;
}
#fwxyHead {
  background-color: #53cdf5;
}
.backSize{
    height: 26px;
}
.titleSize{
    font-size:1.125em;
    color:#ffffff
}
@media screen and (max-height: 600px){
  .backSize{
      height: 22px;
  }
  .titleSize{
      font-size: 1em;
  }
}
</style>
